<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
<style>
    .big{
        width: 500px;
        height: 500px;
    }
    .small{
        height: 100px;
        width: 100px;
    }
</style>
</head>
<body>
<img src="imgs/1.jpeg" alt="" class="big">
<img src="imgs/1.jpeg" alt="" class="small">
<img src="imgs/2.jpeg" alt="" class="small">
<img src="imgs/3.jpeg" alt="" class="small">
<img src="imgs/4.jpeg" alt="" class="small">
<img src="imgs/5.jpeg" alt="" class="small">
<img src="imgs/6.jpeg" alt="" class="small">
<img src="imgs/7.jpeg" alt="" class="small">
<img src="imgs/8.jpeg" alt="" class="small">
<script>
    var big = document.querySelector('.big');
    var small = document.querySelectorAll('.small');
    for(var i = 0; i < small.length;i++){
           small[i].onmouseenter = function(){
               big.src = this.src;
           }
       }
</script>
</body> 
</html>